//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Mapping Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.Mapping.Properties;

namespace EntLibContrib.Mapping.Configuration.Design
{
	/// <summary>
	/// Node map registrar for the Mapping Application Block
	/// this registers tree nodes with the configuration console
	/// and is used by the node builder to create the appropriate
	/// node type from the data type
	/// </summary>
	public sealed class MappingNodeMapRegistrar : NodeMapRegistrar
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="T:MappingNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">A mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public MappingNodeMapRegistrar(IServiceProvider serviceProvider)
			: base(serviceProvider)
		{
		}
		#endregion

		#region Public Methods
		/// <summary>
		/// Registers the node maps.
		/// </summary>
		public override void Register()
		{
			AddMultipleNodeMap(InternalResources.DefaultCustomMapperNodeName,
												typeof(CustomMapperNode),
												typeof(CustomMapperData));

			AddMultipleNodeMap(InternalResources.DefaultBasicMapperNodeName,
												typeof(BasicMapperNode),
												typeof(BasicMapperData));

			AddMultipleNodeMap(InternalResources.DefaultSuperMapperNodeName,
												typeof(SuperMapperNode),
												typeof(SuperMapperData));

			AddMultipleNodeMap(InternalResources.DefaultCustomMapNodeName,
												typeof(CustomMapNode),
												typeof(CustomMapData));

			AddMultipleNodeMap(InternalResources.DefaultMapNodeName,
												typeof(MapNode),
												typeof(MapData));
		}
		#endregion
	}
}